/* GUI CONVERTED from rcshwbd.p (converter v1.75) Sat Aug 12 23:02:36 2000 */
/* rcshwbd.p  - PRE-SHIPPER WORKBENCH - SUB PROGRAM - ADD EXISTING CONT      */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                       */
/* All rights reserved worldwide.  This is an unpublished work.              */
/*K0JC*/ /*V8:ConvertMode=Maintenance                                        */
/*K1Q4*/ /*V8:WebEnabled=No                                                  */
/* VERSION 8.6            CREATED: 09/24/97   BY: *K0JC*  John Worden        */
/* VERSION 8.6      LAST MODIFIED: 05/20/98   BY: *K1Q4* Alfred Tan          */
/* VERSION 9.1      LAST MODIFIED: 08/12/00   BY: *N0KP* myb                 */


         {mfdeclre.i}


         /* INPUT PARAMETERS */
         define input parameter ship_from like abs_shipfrom no-undo.
         define input parameter tmp_prefix as character no-undo.
         define input parameter shipto_code as character no-undo.
         define input parameter p-abs_format like abs_mstr.abs_format no-undo.

         /* OUTPUT PARAMETERS */
         define input-output parameter abs_recid as recid no-undo.

         /* LOCAL VARIABLES */
         define variable cont_level as integer initial 2 no-undo.
         define variable parent_number like abs_par_id no-undo.
         define variable temp_parent like abs_par_id no-undo.
         define variable abnormal_exit as logical no-undo.
         define variable parent_level as integer no-undo.

         /* CREATE TEMP PARENT FOR RECORD MANIPULATION */
         temp_parent = tmp_prefix.

         /* SAVE PARENT FOR THE NEWLY CREATED RECORDS */
         find abs_mstr where recid(abs_mstr) = abs_recid no-lock no-error.
         if available abs_mstr then do:
           assign
             parent_number = abs_mstr.abs_id
             temp_parent = temp_parent + string(recid(abs_mstr))
             parent_level = integer(abs_mstr.abs__qad06) + 1.
           if parent_level > 9 then do:
             {mfmsg.i 758 4} /* MAX LEVELS EXCEEDED */
             return.
           end. /* if parent_level > 9 */
         end. /* if available abs_mstr */

         {gprun.i ""rcshwbd1.p""
           "(input ship_from,
             input temp_parent,
             input cont_level,
             input parent_number,
             input tmp_prefix,
             input p-abs_format,
             input shipto_code)"}
/*GUI*/ if global-beam-me-up then undo, leave.

